source(here::here("code/load.R"))

here("data/meta_analyses_raw/Lu2016/table1_p387-8.csv") |>
    read_csv() |>
    mutate(meta_id = "Lu2016",
           subfield = "PA",
           question = "Do government grants displace or leverage private donations to nonprofit organizations?",
           study_year = gsub(".*(\\d{4}).*", "\\1", Study),
           study_year = as.numeric(study_year),
           conf.low = as.numeric(gsub("\\((.*),.*", "\\1", `95_CI`)),
           conf.high = as.numeric(gsub(".*, (.*)\\)", "\\1", `95_CI`)),
           std.error = (conf.high - conf.low) / 3.92,
           overall_effect = "yes") |>
    select(meta_id,
           subfield,
           question,
           study_id = Study,
           study_year = study_year,
           estimate = Average_Effect_Size,
           std.error,
           conf.low,
           conf.high,
           overall_effect) |>
    write_csv(here("data/meta_analyses_clean/Lu2016.csv"))
